import { createRouter, createWebHistory } from "vue-router";
import Layout from "@renderer/layout/index.vue";

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: "/",
      component: Layout,
      children: [
        {
          path: "/",
          name: "/",
          component: () => import("@renderer/views/index/index.vue"),
        },
      ],
    },
    {
      path: "/daily",
      component: Layout,
      redirect: "/daily/calendar",
      children: [
        {
          path: "/daily/calendar",
          name: "/daily/calendar",
          component: () => import("@renderer/views/daily/calendar/index.vue"),
        },
      ],
    },
    {
      path: "/office",
      component: Layout,
      redirect: "/office/convert",
      children: [
        {
          path: "/office/convert",
          name: "/office/convert",
          component: () => import("@renderer/views/office/convert/index.vue"),
        },
        {
          path: "/office/convert/jsonTools",
          name: "/office/convert/jsonTools",
          component: () => import("@renderer/views/office/convert/JSONTools/index.vue"),
        },
        {
          path: "/office/convert/imageTools",
          name: "/office/convert/imageTools",
          component: () => import("@renderer/views/office/convert/ImageTools/index.vue"),
        },
        {
          path: "/office/text",
          name: "OfficeText",
          component: () => import("@renderer/views/office/text/index.vue"),
        },
        {
          path: "/office/markdown",
          name: "OfficeMarkdown",
          component: () => import("@renderer/views/office/markdown/index.vue"),
        },
      ],
    },
    {
      path: "/math",
      component: Layout,
      redirect: "/math/convert",
      children: [
        {
          path: "/math/convert",
          name: "/math/convert",
          component: () => import("@renderer/views/math/convert/index.vue"),
        },
        {
          path: "/math/generator",
          name: "/math/generator",
          component: () => import("@renderer/views/math/generator/index.vue"),
        },
      ],
    },
    {
      path: "/tools",
      component: Layout,
      redirect: "/tools/index",
      children: [
        {
          path: "/tools/index",
          name: "ToolsIndex",
          component: () => import("@renderer/views/tools/index.vue"),
        },
        {
          path: "/tools/eyeDropper",
          name: "ToolsEyeDropper",
          component: () => import("@renderer/views/tools/eyeDropper/index.vue"),
        },
        {
          path: "/tools/clock",
          name: "ToolsClock",
          component: () => import("@renderer/views/tools/clock/index.vue"),
        },
      ],
    },
    {
      path: "/moreYu",
      component: Layout,
      redirect: "/moreYu/index",
      children: [
        {
          path: "/moreYu/index",
          name: "MoreYuIndex",
          component: () => import("@renderer/views/moreYu/index.vue"),
        },
        {
          path: "/moreYu/saibomuyu",
          name: "MoreYuSaiBoMuYu",
          component: () => import("@renderer/views/moreYu/saibomuyu/index.vue"),
        },
      ],
    },
  ],
});

export default router;
